//
//  NSDateFormatter+TP_Utility.m
//  E_Car
//
//  Created by 谭鹏 on 2017/7/3.
//  Copyright © 2017年 谭鹏. All rights reserved.
//

#import "NSDateFormatter+TP_Utility.h"

@implementation NSDateFormatter (TP_Utility)
+(NSString *)dateStringFromTimestamp:(NSTimeInterval)timestamp format:(NSString *)format{
    NSDateFormatter * df = [NSDateFormatter new];
    df.dateFormat = format;
    return  [df stringFromDate:[NSDate dateWithTimeIntervalSince1970:timestamp]];
}
+(NSString *)dateStringFromDate:(NSDate*)date Format:(NSString *)format {
    NSDateFormatter * df = [NSDateFormatter new];
    df.dateFormat = format;
    df.timeZone = [NSTimeZone timeZoneWithAbbreviation:@"UTC+800"];
    return  [df stringFromDate:date];
}
@end
